# Copyright 2012 Sergio, Raul, Dorival. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

SET(PARMETIS_INCLUDE_SEARCH_PATH
    /usr/include/metis
    /usr/include/parmetis
    /usr/include/)

SET(PARMETIS_LIBRARY_SEARCH_PATH
    /usr/lib)

FIND_PATH(PARMETIS_METIS_H metis.h ${PARMETIS_INCLUDE_SEARCH_PATH})
FIND_LIBRARY(PARMETIS_METIS NAMES metis PATHS ${PARMETIS_LIBRARY_SEARCH_PATH})

FIND_PATH(PARMETIS_PARMETIS_H parmetis.h ${PARMETIS_INCLUDE_SEARCH_PATH})
FIND_LIBRARY(PARMETIS_PARMETIS NAMES parmetis PATHS ${PARMETIS_LIBRARY_SEARCH_PATH})

SET(PARMETIS_FOUND 1)
FOREACH(var PARMETIS_METIS_H PARMETIS_PARMETIS_H PARMETIS_METIS PARMETIS_PARMETIS)
  IF(NOT ${var})
	SET(PARMETIS_FOUND 0)
  ENDIF(NOT ${var})
ENDFOREACH(var)

IF(PARMETIS_FOUND)
  SET(PARMETIS_INCLUDE_DIRS ${PARMETIS_METIS_H} ${PARMETIS_PARMETIS_H})
  SET(PARMETIS_LIBRARIES    ${PARMETIS_METIS} ${PARMETIS_PARMETIS})
ENDIF(PARMETIS_FOUND)
